solve an equation by completing the square